package ru.amse.tsyganov.jumleditor.properties;

import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.CheckboxCellEditor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Table;

import ru.amse.tsyganov.jumleditor.view.preferences.Images;

public abstract class BooleanProperty extends Property<Boolean> {

	public BooleanProperty(String name) {
		super(name);
	}
	
	@Override
	public CellEditor createCellEditor(Table table) {
		return new CheckboxCellEditor(table);
	}
	
	@Override
	public String getStringPropertyValue() {
		return null;
	}
	
	@Override
	public Image getImage() {
		
		return  getPropertyValue() ? 
				Images.getCheckedImage() : 
					Images.getUncheckedImage();
	}
}
